package com.study.designmodel.abstractfactory;

import com.study.designmodel.factory.Circle;
import com.study.designmodel.factory.Rectangle;
import com.study.designmodel.factory.Shape;
import com.study.designmodel.factory.Square;


/**
 * @description: ShapeFactory
 * @date: 2021/2/4 0:26
 * @author: hcm
 * @version: 1.0
 */
public class ShapeFactory extends AbstractFactory{

    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shapeType) {
        if (shapeType == null) {
            return null;
        }
        if(shapeType.equalsIgnoreCase("C")){
            return new Circle();
        }else if(shapeType.equalsIgnoreCase("R")){
            return new Rectangle();
        }else if(shapeType.equalsIgnoreCase("S")){
            return new Square();
        }
        return null;
    }
}
